<template>
  <div>
    <div>  <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="收件人">

        <el-select v-model="form.tos" prop="" placeholder="请选择收件人">
          <el-option label="系统管理员" value="1220827789@qq.com"></el-option>
          <el-option label="讲座信息管理员" value="962552476@qq.com"></el-option>
          <el-option label="预约信息管理员" value="773795535@qq.com"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="主题">
        <el-input v-model="form.subject"></el-input>
      </el-form-item>
      <el-form-item  label="正文">
        <el-input type="textarea"  v-model="form.content"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button  type="primary" @click="showDialogVisible">立即发送</el-button>
      </el-form-item>
    </el-form>
    </div>
    <div>
      <el-dialog
          title="提示"
          :visible.sync="dialogVisible"
          width="30%"
      >
        <span>是否发送</span>
        <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="onSubmit">确 定</el-button>
  </span>
      </el-dialog>
    </div>
  </div>


</template>

<script>
export default {
  name: "BasicSendEmail",
  data() {
    return {
      dialogVisible:false,
      form: {
        tos: '',
        subject: '申请提升权限',
        content: '需要发布讲座,请求提升权限'
      }
    }
  },
  methods: {
    showDialogVisible()
    {
      this.dialogVisible=true;
    },

    onSubmit() {

      this.postRequest('/system/sendEmail/postMail?tos='+this.form.tos+'&subject='
          +this.form.subject+'&content='+this.form.content
      ).then(resp=>{
        if(resp)
        {
          this.dialogVisible=false;
        }
      })

    }
  }
}
</script>

